1. Field of the Invention
This invention is in the field of digital data processing systems and more particularly relates to apparatus in a data processing system for implementing an instruction to move a binary number stored in an addressable register to the memory for storage beginning at a designated memory location. The form, or format, or the binary number may be incompatible with the system's capability for retrieving the number from the word addressable memory of the system. In implementing the instruction, the apparatus places the binary number in a format compatible with its being stored so that it can be subsequently retrieved.
2. Description of the Prior Art
Digital data processing systems are optimized to handle a given number of bits in parallel, or as an entity, with such an entity being defined as a word, or a machine word. A word in turn can be defined as including a plurality of bytes with each byte containing a given number of bits. There is no agreed to standard for the number of bits to a byte. Some computer equipment manufacturers have standardized their equipment to use an 8 bit byte while others use a 9 bit byte. In this application the word byte when used without a prefix, or modifier, will mean a 9 bit byte.
Some data processing systems organize their memories, or working store, on the basis that each addressable memory location stores a byte, most commonly an 8 bit byte. Others are organized so that each addressable memory location will store a machine word. Either type of computing system when required to operate on, or process, binary numbers will generally restrict or limit the binary numbers to a given number of characters where a character in an 8 bit byte machine will have 8 bits, an octet; and in a 9 bit byte machine will have 9 bits, a nonet. A word oriented data processing system in which the present invention could be used has a word addressable memory in which a word has 36 bits which are divisible into 4 bytes. To increase the ability of such a word oriented system to compete with 8 bit byte oriented computers, it is desirable that the word oriented computer be able to run application programs written for an 8 bit byte character addressable memory computer system with the minimum of change to the programs and the computer. Such a word oriented computer should be able to handle, which includes reading into memory and writing from memory, binary numbers of from 1 to 4 characters, either octets or nonets efficiently. An advantage derived by a computer having this capability is that it avoids the necessity of users replacing a byte oriented computer from having to rewrite their application programs to run on a word oriented computer. Such a conversion can be both expensive and time consuming. However, to provide a word oriented computer having the characteristics set forth above with the capability of handling binary numbers having a limited number of characters of either 8 or 9 bits per character requires that the computer have the ability to store a binary number in a memory location with the most significant character of the binary number, the one that contains the most significant bit of the binary number, being stored in any one of 4 byte locations of a word at an address designated in the instruction. Any characters of the binary number which overflow a word boundary are stored in an adjacent, or contiguous, memory address. Whether an overflow will occur depends upon the number of characters in a given binary number and the byte location in the first word containing the most significant character in the binary number. The second word, if needed, will have placed in it bytes containing characters of the binary number which bytes are positioned so that they are left justified against a word boundary. The bytes containing characters are positioned in order of decreasing significance from left to right. Where 8 bit characters are to be stored in a 9 bit byte location or position, the most significant bit position of each byte will have a fill bit, normally a logical zero, stored in it.
Given a binary number of from 1 to 4 characters with each character of the given binary number having either 8 or 9 bits per character which are stored in a designated one of a group of addressable registers with the characters of the binary number being right justified against a word or half word boundary; the problem is how to efficiently store the characters of the binary number in a word addressable memory so that they can be efficiently retrieved from a word addressable memory. To do so requires that there be only one character per byte position and that the location of the bytes containing the characters is easily and accurately determinable. One way of accomplishing this is by placing the most significant character of the binary number in a designated one of the four byte positions of the word to be stored at a given memory location with the other bytes containing characters being placed in order. More particularly the problem is how to efficiently move a binary number as it exists in a designated addressable register to a data out register with the byte containing the most significant character of the binary number positioned in a first word in the data out register so that the byte containing the most significant character will be positioned in the first word in a byte position determined by the instruction with the other bytes containing characters of the binary number being positioned in the first word in order of decreasing significance. If bytes containing characters of the binary number overflow or cross over a word boundary of the first word then such overflow bytes are left justified and stored in order in a second word to be stored in the data out register after the first word has been transmitted to memory for storage in the designated memory location.
Heretofore the manner in which this particular function has been performed has been by software programs. Such programs, however, require a significant number of instructions, each of which instructions may require several clock periods so that a significant amount of time, comparatively speaking, is required to execute such a program. The penalty in performance, measured in terms of throughput of a data processing system which must make such transformations, obviously, adversely affect the ability of such data processing system to compete effectively with data processing system organized to directly address the characters of the binary number in memory, particularly in performing programs which require operating on a large number of pure binary numbers divisible into 8 bit characters.